#导入本章示例用到的包
import numpy as np
import cv2 as cv
import matplotlib. pyplot as plt
from skimage import io, exposure, color, util
#改变图像对比度
img = cv.imread('./img/1.jpg', 0)#读入一幅灰度图像
#采用OpenCV函数
imgcu = cv. multiply(img,1.5)
imgcd = cv. multiply(img,0.5)
cv.imshow('1',imgcu)
cv.imshow('2',imgcd)
cv.waitKey(0)